+2009-01-17 Martin Nordholts <martinn@svn.gnome.org>
+
+ Instead of having BABL_CLASS() plus variants and making the macros
+ expand to different things depending on if they are used in a
+ header or a .c file, have two versions: BABL_CLASS_DECLARE() and
+ BABL_CLASS_IMPLEMENT(). This enables further refactorisation of
+ the babl.h header.
+
+ * babl.h: Do the name changes and remove the unpleasant #undefs at
+ the bottom.
+
+ * babl-internal.h: Do the name changes.
+
+ * babl-component.[ch]
+ * babl-conversion.[ch]
+ * babl-extension.[ch]
+ * babl-fish.[ch]
+ * babl-format.[ch]
+ * babl-image.h
+ * babl-model.[ch]
+ * babl-sampling.h
+ * babl-type.[ch]: Adjust to changes.
+
2009-01-17 Martin Nordholts <martinn@svn.gnome.org>
Don't redeclare functions declared with the BABL_CLASS() or
return babl;
}
-BABL_CLASS (component)
+BABL_CLASS_IMPLEMENT (component)
/****************************************************************/
/* BablComponent */
-BABL_NAMED_CLASS (component);
+BABL_NAMED_CLASS_DECLARE (component);
/*
* Babl * babl_component_new (const char *name,
* NULL);
return error;
}
-BABL_CLASS (conversion)
+BABL_CLASS_IMPLEMENT (conversion)
/****************************************************************/
/* BablConversion */
-BABL_NAMED_CLASS (conversion);
+BABL_NAMED_CLASS_DECLARE (conversion);
/*
* Babl * babl_conversion_new (<BablFormat *source, BablFormat *destination|
* BablModel *source, BablModel *destination|
return 0; /* continue iterating */
}
-BABL_CLASS (extension)
+BABL_CLASS_IMPLEMENT (extension)
/****************************************************************/
/* BablExtension */
-BABL_NAMED_CLASS (extension);
+BABL_NAMED_CLASS_DECLARE (extension);
/*
* BablExtension objects are only used internally in babl.
*/
return 0; /* continue iterating */
}
-BABL_CLASS_MINIMAL (fish);
+BABL_CLASS_MINIMAL_IMPLEMENT (fish);
/****************************************************************/
/* BablFish */
-BABL_CLASS (fish);
+BABL_CLASS_DECLARE (fish);
/* Create a babl fish capable of converting from source_format to
* destination_format, source and destination can be
* either strings with the names of the formats or BablFormat objects.
return loss;
}
-BABL_CLASS (format)
+BABL_CLASS_IMPLEMENT (format)
/****************************************************************/
/* BablFormat */
-BABL_NAMED_CLASS (format);
+BABL_NAMED_CLASS_DECLARE (format);
/*
* Babl * babl_format_new (["name", const char *name,]
* BablModel *model,
/****************************************************************/
/* BablImage */
-BABL_CLASS (image);
+BABL_CLASS_DECLARE (image);
/*
* Babl images can be used for planar buffers instead of linear buffers for
* babl_process(), BablImages are still experimental, for now BablImages can be
* to be kept in sync with the C files.
*/
-#define BABL_CLASS_MINIMAL(klass) \
+#define BABL_CLASS_MINIMAL_IMPLEMENT(klass) \
void \
babl_##klass##_init (void) \
{ \
babl_db_each (db, each_fun, user_data); \
} \
-#define BABL_CLASS(klass) \
-BABL_CLASS_MINIMAL(klass) \
+#define BABL_CLASS_IMPLEMENT(klass) \
+BABL_CLASS_MINIMAL_IMPLEMENT(klass) \
\
Babl * \
babl_##klass (const char *name) \
return symmetric;
}
-BABL_CLASS (model)
+BABL_CLASS_IMPLEMENT (model)
/****************************************************************/
/* BablModel */
-BABL_NAMED_CLASS (model);
+BABL_NAMED_CLASS_DECLARE (model);
/*
* Babl * babl_model_new (["name", const char *name,]
* BablComponent *component1,
/****************************************************************/
/* BablSampling */
-BABL_CLASS (sampling);
+BABL_CLASS_DECLARE (sampling);
/**/
Babl * babl_sampling (int horizontal,
int vertical);
return is_symmetrical;
}
-BABL_CLASS (type)
+BABL_CLASS_IMPLEMENT (type)
/****************************************************************/
/* BablType */
-BABL_NAMED_CLASS (type);
+BABL_NAMED_CLASS_DECLARE (type);
/*
* A data type that babl can have in it's buffers, requires
* conversions to and from "double" to be registered before
* to be iterated over, common functionality is defined through these
* macros.
*/
-#define BABL_CLASS(klass) \
+#define BABL_CLASS_DECLARE(klass) \
\
void babl_##klass##_init (void); \
void babl_##klass##_destroy (void); \
* the means to lookup by name, as well as to create new named objects
* that later can be looked up.
*/
-#define BABL_NAMED_CLASS(klass) \
+#define BABL_NAMED_CLASS_DECLARE(klass) \
\
-BABL_CLASS (klass); \
+BABL_CLASS_DECLARE (klass); \
Babl * babl_##klass (const char *name); \
Babl * babl_##klass##_new (void *first_arg, \
...) BABL_ARG_NULL_TERMINATED
BablExtension extension;
} _Babl;
-#undef BABL_CLASS
-#undef BABL_NAMED_CLASS
-
#endif